package com.example.rabbitmq.direct.service;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;

/**
 * @Auther:
 * @Description:
 * @Date: 2020/1/9 14:01
 */
//@Component
@RabbitListener(queues = "myDirectQueueResponse")// 监听MQ中名称为 MyDirectQueue 的队列
public class ListenResponse {

    @RabbitHandler
    public void process(String message) {
        try {
            System.out.println("服务端发送完消息接收到客户端回复的消息为：  " + message);

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
